package com.example.medicine.View;

import com.example.medicine.Mapper.xslrMapper;
import com.example.medicine.Mapper.yonghuMapper;
import com.itextpdf.forms.xfdf.Mode;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
@Slf4j
@Controller
public class xslrView {
    @Autowired
    private xslrMapper xslrMapper;
    @Autowired
    private yonghuMapper yonghuMapper;
    Subject subject = SecurityUtils.getSubject();
    @RequiresPermissions("学生录入查询")
    @RequestMapping("/xslr")
    public String xslrShow(Model model){
        log.info("学生录入列表页面");
        List<String> yonghuId = yonghuMapper.getUserIdFour();
        List<String> yonghuCompany = yonghuMapper.getCompany();
        model.addAttribute("yonghuId",yonghuId);
        model.addAttribute("yonghuCompany",yonghuCompany);
        model.addAttribute("roleType",yonghuMapper.getTypeByUserId(subject.getPrincipal().toString()));
        return "pages/yian/list_s";
    }
}
